from import_export import resources
from hema.models import Data


class DataResource(resources.ModelResource):
    def get_export_headers(self):
        # 是你想要的导出头部标题headers
        return ['地区', '分类名', '标题', '月销', '原价', '现价', '库存', ]

    class Meta:
        model = Data
        fields = ('place', 'classname', 'title', 'cell', 'price', 'sku', 'time', )
        export_order = ('place', 'classname', 'title', 'cell', 'price', 'sku', 'time', )